<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<div class="alert alert-info">用户列表</div>
<div class="panel panel-default">
  <div class="panel-heading">查询条件</div>
  <div class="panel-body">
    <div class="row">
			<form class="form-inline" action="${pageContext.request.contextPath }/FindUsersServlet" method="GET">
				<input type="hidden" name="page" value="1">
				<div class="col-md-4">
					<div class="form-group">
					    <label>ID：</label>
					    <input type="text" name="id" class="form-control">
					  </div>
				</div>
				<div class="col-md-4">
					<div class="form-group">
					    <label>用户名：</label>
					    <input type="text" name="username" class="form-control">
					  </div>
				</div>
				<div class="col-md-4">
					<input class="btn btn-primary" type="submit" value="查询" style="margin-right: 30px;">
					<input class="btn btn-default" type="reset" value="重置">
				</div>
			</form>
		</div>
  </div>
</div>
<table class="table table-bordered">
	<tr>
		<th>ID</th>
		<th>用户名</th>
		<th>性别</th>
		<th>邮箱</th>
		<th>手机号码</th>
		<th>个人简介</th>
		<th>注册时间</th>
		<th>操作</th>
	</tr>
	<c:forEach items="${users}" var="user">
		<tr>
			<td>${user.getId()}</td>
			<td>${user.getUsername()}</td>
			<td>${user.getGender()}</td>
			<td>${user.getEmail()}</td>
			<td>${user.getTelephone()}</td>
			<td>${user.getIntroduce()}</td>
			<td>${user.getRegistTime()}</td>
			<td>
				<a href="${pageContext.request.contextPath }/FindUserAddressServlet?id=${user.getId()}" class="btn btn-info">查看地址</a>
				<a href="${pageContext.request.contextPath }/FindUserCollectionServlet?id=${user.getId()}" class="btn btn-info">查看收藏</a>
			</td>
		</tr>
	</c:forEach>
</table>
<nav>
  <ul class="pager">
  	<c:if test="${hasPrev}">
  		<li class="previous"><a href="${pageContext.request.contextPath}/FindUsersServlet?page=${_page - 1}"><span aria-hidden="true">&larr;</span>上一页</a></li>
  	</c:if>
  	<c:if test="${hasNext}">
    	<li class="next"><a href="${pageContext.request.contextPath}/FindUsersServlet?page=${_page + 1}">下一页 <span aria-hidden="true">&rarr;</span></a></li>
  	</c:if>
  </ul>
</nav>